<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style>
		#box{
			width:50px; height: 50px; background: blue;
			position: absolute; left: 0; top: 0;
			border-radius: 50%;
		}
	</style>
	<script type="text/javascript">
		
		//做直线运动
		onload = function(){
			var box = document.getElementById("box");
			setTimeout(function(){
				//向右运动
				box.style.left = box.offsetLeft + 5 + "px";
				
				//向下运动
				box.style.top = box.offsetTop + 3 + "px";
				
				setTimeout(arguments.callee,30);
			},30);
			
		}
	</script>
	<body>
		<div id="box">
			
		</div>
	</body>
</html>
